package com.group3.hospital.controller;

import com.group3.hospital.bean.Doctor;
import com.group3.hospital.mapper.DpartAllDocsMapper;
import com.group3.hospital.service.DpartAllDocsService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 秀秀
 */
@Controller
@SessionAttributes(names = {"doctor"})
public class DparmentAllDocsController {

    @Resource
    private DpartAllDocsService dpartAllDocsService;

    //展示全部部门医生画面
    @RequestMapping("/dpartUi")
    public String dpartUi(Model model){
        try {
            List<Doctor> doctors = dpartAllDocsService.queryAllDocsBydepIdAndSub1();
            model.addAttribute("doctors",doctors);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "dpartmentAllDocs";
    }
}
